import Vue from 'vue'
import Vuex from 'vuex'
import getters from './getters'
import app from './modules/app'
import settings from './modules/settings'
import user from './modules/user'
import tagsView from './modules/tagsView'

// 添加permission
import permission from './modules/permission'
// 公共业务数据
import commonState from './modules/commonState'

Vue.use(Vuex)
// vuex 持久化
import persistedState from "vuex-persistedstate"
const store = new Vuex.Store({
  modules: {
    app,
    settings,
    tagsView,
    user,
    permission,
    commonState,
  },
  getters,
  state:{},
  mutations:{},
  actions:{},
  plugins: [persistedState({ 
    key:'vuex',
    paths:['app','user','settings','permission','commonState']
  })]
})

export default store
